package com.link2room.ironhide.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/11/29.
 */
@Entity
@Table(name = "img_repertory")
public class ImgRepertory extends BaseEntity{
    private String url;
    private String hashCode;
    private String remak;
    private String imgCode;

    @Basic
    @Column(name = "url", nullable = false, length = 512)
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "hashCode", nullable = false, length = 128)
    public String getHashCode() {
        return hashCode;
    }

    public void setHashCode(String hashCode) {
        this.hashCode = hashCode;
    }

    @Basic
    @Column(name = "remak", nullable = true, length = 128)
    public String getRemak() {
        return remak;
    }

    public void setRemak(String remak) {
        this.remak = remak;
    }
    @Basic
    @Column(name = "img_code", nullable = true, length = 128)
    public String getImgCode() {
        return imgCode;
    }

    public void setImgCode(String imgCode) {
        this.imgCode = imgCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ImgRepertory that = (ImgRepertory) o;

        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        if (hashCode != null ? !hashCode.equals(that.hashCode) : that.hashCode != null) return false;
        if (remak != null ? !remak.equals(that.remak) : that.remak != null) return false;
        if (imgCode != null ? !imgCode.equals(that.imgCode) : that.imgCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = url != null ? url.hashCode() : 0;
        result = 31 * result + (hashCode != null ? hashCode.hashCode() : 0);
        result = 31 * result + (remak != null ? remak.hashCode() : 0);
        result = 31 * result + (imgCode != null ? imgCode.hashCode() : 0);
        return result;
    }
}
